﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>

<div id="right">

<div class="nav"><a href="/Home/Index">首页</a></div>
<div class="nav"><a onclick="Nav('renmai');">人脉</a></div>
<div class="nav"><a onclick="Nav('yingyong');">应用</a></div>
<div class="nav"><a onclick="Nav('zhanghaoguanli')">账号</a></div>
<div class="nav"><a onclick="Nav('yaoqing')">邀请</a></div>
<script type="text/javascript">

    function Nav(dialogname) {

        $('#' + dialogname).dialog({ autoOpen: true, width: 570, height: 300, resizable: false, modal: true });
    }


    function AddShare() {
        var dialogname = 'sharedialog';
        var content = '<div id="share">	<input type="text" /><button>分享</button>	<textarea style="display:none;"></textarea></div>';
        $('body').append('<div title="分享能让你在派对上更受关注!" id="' + dialogname + '">' + content + '</div>');
        $('#' + dialogname).dialog({ autoOpen: true, width: 800, height: 240, resizable: false, modal: true });


        $('#share button').click(function () {
            var link = $('#share input').val();
            if ($('#share button').html() == '分享') {
                $.ajax({ url: '/Share/AnalyseShare', data: { link: link }, dataType: 'json', type: 'post', success: function (data) {
                    $('#share textarea').html(data.description).show();
                    $('#share button').html('发布');
                }
                });
            } else {

                var content = $('#share textarea').val();
                var link = $('#share input').val();

                $.ajax({ url: '/Share/AddShare', data: { description: content, link: link }, type: 'post', success: function (data) {
                    $('#share textarea').html('').hide();
                    $('#share button').html('分享');
                    $('#share input').val('');
                    $('#' + dialogname).remove();
                    cAlert(data);
                }
                });
            }



        });


}
function cAlert(data) {
    jAlert(data, "School Party");
}
    function RequestLover() {


        $.ajax({
            type: 'POST',
            url: "http://" + window.location.host + "/Relation/CreateRequestLover",
            success: function (data) {
                if (data.indexOf("失败") > 0 || data.indexOf("lover")>0) {
                    var content = '<p>请将以下链接发送给你的另一半:</p><p><a>http://' + window.location.host + data + '</a></p>';
                    $('body').append('<div id="bbb">' + content + '</div>');
                    $('#bbb').dialog({ autoOpen: true, width: 800, height: 240, resizable: false, modal: true });
                }
                else { cAlert(data); }

                $('#yaoqing').dialog('close');
            },
            error: function () {
                Error();
            }

        });

    }
    function InviteFriend() {

        $.ajax({
            type: 'POST',
            url: "http://" + window.location.host + "/Relation/CreateRequestFriend",
            success: function (data) {
                
                var content = "<p>请将一下连接发送给你的朋友:</p><p><a>http://" + window.location.host + data + "</a></p>";
                $('body').append('<div id="invite_f_dialog">' + content + '</div>');
                $('#invite_f_dialog').dialog({autoOpen: true, width: 800, height: 240, resizable: false, modal: true });
            },
            error: function () {
                alert('posterror');
            }

        });
        
    }



</script>

<link href="../../Content/ui/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css" />
<script src="../../Content/ui/jquery-ui-1.8.16.custom.js" type="text/javascript"></script>
<div style="display:none" class="showdialog" id='renmai' title="人脉">
<div><p><a class="showa" href="/Relation/ShowFriendList?currentpage=1">好友</a><a class="showb">(丰富的人脉能让你在派对上如鱼得水)</a></p><p><a class="showa" href="/Relation/ShowFocusList">关注</a><a class="showb">(你是否想要了解TA，那就关注TA吧)</a></p></div>
</div>

<div style="display:none" class="showdialog" id='yingyong' title="应用">
<div><p><a class="showa" href="/Album">相册</a><a class="showb">(想要让别人快速认识你么?上传相片能够提高你的推荐排名哦)</a></p>
<p><a class="showa" href="/Movie">电影</a><a class="showb">(了解周边电影,助你成为校园达人)</a></p>
<p><a class="showa pointer" onclick="AddShare();">分享</a><a class="showb">(丰富的分享，能引起别人更多的关注)</a></p>
<p><a class="showa" href="/Article">文章</a><a class="showb">(展示你的文采,也可以聊聊生活)</a></p>
<p><a class="showa" href="/Feeling/ShowFeelingList">心情</a><a class="showb">(心情日记里记录了你生活的点点滴滴)</a></p>
</div>
</div>

<div style="display:none" class="showdialog" id='zhanghaoguanli' title="账号管理">
<div><p><a class="showa" href="/Account/ManageUserInfo">完善资料</a><a class="showb">(想要了解更多的人么?完善资料能为你带来更好的推荐)</a></p><p><a class="showa" href="/Account/ChangeSecret">保密问题</a><a class="showb">(保密问题能让你的账号更安全)</a></p>
<p><a class="showa" href="/Account/ChangePassword">修改密码</a><a class="showb">(定时修改密码能让你的账号更安全)</a></p>
<%if (Request.IsAuthenticated)
  {%>
  <p><a class="showa" href="/Account/LogOff">离开派对</a><a class="showb">(离开网站派对，去参加现实的派对吧)</a></p>
  <%}
  else
  { %>
  <p><a class="showa" href="/Account/LogOn">开始派对</a><a class="showb">(朋友们都在派对了,快登陆参加吧)</a></p>
  <%} %>
</div>
</div>

<div style="display:none" class="showdialog" id='yaoqing' title="邀请">
<div><p><a class="showa pointer" onclick="RequestLover();">邀请情侣</a><a class="showb">(丰富的人脉能让你在派对上如鱼得水)</a></p>
<p><a class="showa pointer" onclick="InviteFriend();">邀请好友</a><a class="showb">(派对的人是不是太少了?快邀请朋友来参加吧)</a></p>
<p><a class="showa pointer" href="/Relation/ShowFeedBack">曾经邀请</a><a class="showb">(小小的记录记住你真诚的邀请)</a></p>

</div>
</div>

<%--结束符--%>
</div>